package com.o2opuzi.lib.util;

import java.util.Random;
import java.util.UUID;

public class RandomStringUtils {
	
	
	private static final String[] LETTERS = {
		"a","b","c","d","e","f","g","h","j","k","n",
		"m","x","w","y","z","i"
	};
	
	private static final  String[] STRINGS = {
		"0","1","2","3","4","5","6","7","8","9",
		"a","b","c","d","e","f","g","h","j","k","n",
		"m","x","w","y","z","i","l","Q","W","E","R",
		"T","Y","U","P","A","S","D","F","G","H","J","K","Z","X","C","V","B","N","M"
	};
	
	public static String randomString(int length){
		StringBuilder str = new StringBuilder();
		for (int i = 0; i < length; i++)
			str.append(STRINGS[new Random().nextInt(STRINGS.length)]);
		return str.toString();
	}
	
	public static String randomNum(int num){
		StringBuilder strNum = new StringBuilder();
		for (int i = 0; i < num; i++)
			strNum.append(new Random().nextInt(9));
		return strNum.toString();
	}
	
	public static String uuid(){
		return UUID.randomUUID().toString().replace("-", "").toUpperCase();
	}
	
	public static String randomLetter(int length){
		StringBuilder str = new StringBuilder();
		for (int i = 0; i < length; i++)
			str.append(LETTERS[new Random().nextInt(LETTERS.length)]);
		return str.toString();
	};
	
	public static void main(String[] args) {
		for (int i = 0; i < 1000; i++) {
			System.out.println(randomNum(9));
		}
	}
}
